<?php if (!defined("_INDEX")) { header("Location: /"); die;} ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>Личный кабинет/Смелый взгляд</title>
	<link rel="icon" type="image/png" href="/favicon.png" />
	<link href="/files/style/styles.css" rel="stylesheet" type="text/css" />
	<link href="/files/js/jquery.ui/css/ui-lightness/jquery.ui.css" rel="stylesheet" type="text/css" />
	
	<script type="text/javascript" src="/files/js/jquery.js"></script>
	<script type="text/javascript" src="/files/js/jquery.ui/js/jquery.ui.min.js"></script>
	<script type="text/javascript" src="/files/js/main.js"></script>
</head>
<body>
	<div id='center'>
		<div id='header'>
			<div id='header_left'><div>Личный кабинет</div></div>
			<div id='header_center'></div>
			<div id='header_right'>
				<div class='header_text'>
					<div class='header_sname'><?php echo $user->getSName();?></div>
					<div class='header_name'><?php echo $user->getName()." ".$user->getTName(); ?></div>
					<div class='header_links'><a href='/'>на сайт</a> | <a href='/auth/logout'>выход</a></div>
				</div>
			</div>
		</div>

		<div class='cabinet_menu'>
			<a class="mbutton <?php if($route->getAction()=="profile") echo "mbactive"?>" href="/cabinet/profile">Профиль</a>
			<a class="mbutton <?php if($route->getAction()=="news") echo "mbactive"?>" href="/cabinet/news/view">Новости</a>
			<a class="mbutton <?php	if($route->getAction()=="messages") echo "mbactive"?>" href="/cabinet/messages/received">Сообщения<?php
				$unread_messages = $db->getCell("select count(`message_id`) from `messages` where `recipient_id` = '".$user->getUserId()."' and `read` = '0' and `show_recipient` = '1'");
				if ($unread_messages)
					echo " ($unread_messages)";
			?></a>
		</div>